package arrayDemo;

/**
 * @author: snail_mount
 * @date: 20/1/28 16:33
 * @description: 案例需求:
 * 定义一个方法，用于比较两int个数组的内容是否相同
 */
public class CompareEqually {
    public static void main(String[] args) {
        int[] arr1 = {11, 22, 33, 44, 55};
        int[] arr2 = {11, 22, 33, 44, 55};
        boolean flag = compare(arr1, arr2);
        System.out.println(flag);
    }

    private static boolean compare(int[] arr1, int[] arr2) {
        if (arr1.length!=arr2.length) {
            return false;
        }
        for (int i = 0; i < arr1.length; i++) {
            if (arr1[i] != arr2[i]) {
                return false;
            }
        }
        return true;
    }
}
